//
//  XMRechargeListTableViewCell.m
//  XunMi
//
//  Created by MacBook on 2024/3/1.
//  Copyright © 2024 TieZhu. All rights reserved.
//

#import "XMRechargeListTableViewCell.h"
#import "XMRechargeModel.h"

@interface XMRechargeListTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *typeLa;
@property (weak, nonatomic) IBOutlet UILabel *dateLa;
@property (weak, nonatomic) IBOutlet UILabel *valueLa;
@property (weak, nonatomic) IBOutlet UILabel *blanceLa;
@property (weak, nonatomic) IBOutlet UILabel *type1La;

@end

@implementation XMRechargeListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setModel:(XMRechargeModel *)model {
    _model = model;
    self.typeLa.text = kValueToString(model.consume_type);
    self.type1La.text = kValueToString(model.change_notes);
    self.dateLa.text = kValueToString(model.operate_time);
    self.blanceLa.text =kStringFormat(@"剩余金币：%@", model.golds_number);
    
    NSString *str = kStringFormat(@"%@金币", model.change_golds);
    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:str];
    [attrStr addAttributes:@{NSFontAttributeName: kUIFontBold(16)} range:[str rangeOfString:model.change_golds]];
    [attrStr addAttributes:@{NSFontAttributeName: kUIFontBold(12)} range:[str rangeOfString:@"金币"]];
    self.valueLa.attributedText = attrStr;
}

@end
